package com.example.bookshop.service.user;

import com.example.bookshop.entity.Business;
import com.example.bookshop.repository.BusinessRepository;
import com.example.bookshop.repository.CustomerRepository;
import com.example.bookshop.util.MyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.util.HashMap;

@Service
public class BusinessServiceImpl implements BusinessService{
    @Autowired
    private BusinessRepository businessRepository;
    @Autowired
    private CustomerRepository customerRepository;

    @Override
    public Business getBusiness(HttpSession session) {
        MyUtil myUtil=new MyUtil();
        return businessRepository.findBusinessByUserId(myUtil.getUserId(session));
    }
}
